UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqSEMqoQe3zWnUqFXXr5XVY9568iF0r9MNUaeICAt6g='
WHERE
key_id = '3408dbdae57944b6d30ce2eb013b1006a8606b24539dc16e33913aece86dedaa'
AND (
token = 'EqSEMqoQe3zWnUqFXXr5XVY9568iF0r9MNUaeICAt6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)