UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mq+z81Ah2DrXeRob4jeAiWrBV2A0XD6sf7BGYQE6cq0='
WHERE
key_id = '0b523ee93f6a6b8f427c10e2d92abc2e4c427da9ac06ee939f9238b908bd5af2'
AND (
token = 'mq+z81Ah2DrXeRob4jeAiWrBV2A0XD6sf7BGYQE6cq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)