UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FALILsamt39V6aYaBrt4IyyoYLaQg0ejfden79og/wo='
WHERE
key_id = 'd83ecc9cfc5015657aa1ac857c383456a7e20006b916414499a054a7d6f98d88'
AND (
token = 'FALILsamt39V6aYaBrt4IyyoYLaQg0ejfden79og/wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)