UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AmVpd2dZLsOjEeztFr5lwBKBodzeGemqm/jpTWbvAmE='
WHERE
key_id = '36a586e278d7db88ddd4ea56df5f5ba133aeb4ad43cadbdee0b8ecf3face8531'
AND (
token = 'AmVpd2dZLsOjEeztFr5lwBKBodzeGemqm/jpTWbvAmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)