UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jAk5RnGlcjAON033kcIbA/nHsptxSN9pUAsA9YWeYV0='
WHERE
key_id = '3ca117f291721a32882060c0c75876eb1995aeaae7f11f50109585c9eceae2ff'
AND (
token = 'jAk5RnGlcjAON033kcIbA/nHsptxSN9pUAsA9YWeYV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)