UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/PUTworcT20VfV2yYm+AmDD2ifbo0iViVehgXvOZwUc='
WHERE
key_id = '2a52839661bbe7ea336da902128ac2303be767590c0009499a4d2954e5f575b3'
AND (
token = '/PUTworcT20VfV2yYm+AmDD2ifbo0iViVehgXvOZwUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)