UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45BqDNnjv3VLnJoaNOE5v46ze4PcTFcZ1SwvMmNH/L4='
WHERE
key_id = 'f266dd1eb77280f53e7658ece7bdc34e197b921f34db41ddf4352fdc4144f9d3'
AND (
token = '45BqDNnjv3VLnJoaNOE5v46ze4PcTFcZ1SwvMmNH/L4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)