UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2yu5cF4kbAiKUSFSMcCOMM+lTGDhCQAhiBMXSokQco='
WHERE
key_id = '53a2eabff5d898f9ce66d48a9c9ca826452edcf7699998aea04a54432196f7fd'
AND (
token = 'G2yu5cF4kbAiKUSFSMcCOMM+lTGDhCQAhiBMXSokQco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)