UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQTtUdxw0Ox1quPRDk7Ird3gkm+OTRjUsJyby2XA5SQ='
WHERE
key_id = '5f6f511e8a91179383649e5a50ad384bb2b2892cebb513163f532cd91dd52b4d'
AND (
token = 'wQTtUdxw0Ox1quPRDk7Ird3gkm+OTRjUsJyby2XA5SQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)