UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CJbmfX43WMfGPZcKAl7E4sdik7lHPgIBrGi/RzZXxs4='
WHERE
key_id = '0a7f9f4b45a500d3d227dce787fba75802f56fd26cd241a9119e23cedbfd12fc'
AND (
token = 'CJbmfX43WMfGPZcKAl7E4sdik7lHPgIBrGi/RzZXxs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)