UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92amZ8OW6Ro23Jb7tVfuectdTXL/jc3b9Wc5fTEhYC0='
WHERE
key_id = 'e34dbd29c32ac5ac168a3004974ca4a793b3d73367c5c6c81b259389ff0264fa'
AND (
token = '92amZ8OW6Ro23Jb7tVfuectdTXL/jc3b9Wc5fTEhYC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)