UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LMOO6D8PkTgoerXgjN+Ns3GEUAN7i+gfsA06mrHVxiw='
WHERE
key_id = 'c9da16245c9fd3a18185576d53192d5b703c0bf97f7cd617770c9c9c2cc8430b'
AND (
token = 'LMOO6D8PkTgoerXgjN+Ns3GEUAN7i+gfsA06mrHVxiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)