UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jZrHALZ36Y/88zuMGD6uhaDP+xEilrms/UJADvTgcOU='
WHERE
key_id = 'a88719388660d70f0c035b353391b8d97646cb19494319a4e1be64891231c33e'
AND (
token = 'jZrHALZ36Y/88zuMGD6uhaDP+xEilrms/UJADvTgcOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)