UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fVZWPU7j4T1JqpADr9QTegEYUN1VSMVjN2lDoeD7J5s='
WHERE
key_id = '9467487fcbd4ce158c41902c3e56d3e10446a35bc6f783f373f5e698b14800dc'
AND (
token = 'fVZWPU7j4T1JqpADr9QTegEYUN1VSMVjN2lDoeD7J5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)