UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nAySI6f+5+F2lc0sqV/FEkpcpLNHVK19phBDfbl6JiE='
WHERE
key_id = '33491f3bad4cac604b970e5ffc3bce2a1ad8ec98bd49e610176437e97e0b17af'
AND (
token = 'nAySI6f+5+F2lc0sqV/FEkpcpLNHVK19phBDfbl6JiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)