UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xS6QwV4JudQDIFZrYJx/BJKR9Dow5sTuC6D4Ws9lAZ4='
WHERE
key_id = '32cc86c35a0f32e237a020ef32fadd0133e91df1ced40043911f632142d443c1'
AND (
token = 'xS6QwV4JudQDIFZrYJx/BJKR9Dow5sTuC6D4Ws9lAZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)