UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NznpeKmGUuB6Nr95bi1VBcTXF8Fkk1Bkab8v8jxvI0A='
WHERE
key_id = '4d13cbe0c6d2bac91ee361a7d236427d733f18499490b67183e6157ab1b1f0bf'
AND (
token = 'NznpeKmGUuB6Nr95bi1VBcTXF8Fkk1Bkab8v8jxvI0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)