UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/bG0xdj5CwTDv+SI6OMPlSQcnWIkWB6KyEK58/eSNU='
WHERE
key_id = '60b04e78cfe694982d395d97b43f8ba47cd59161d057feef0e33fb04dafc8bf3'
AND (
token = 'W/bG0xdj5CwTDv+SI6OMPlSQcnWIkWB6KyEK58/eSNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)