UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TMSFmYzrwLpeWVphHavhmNLZaW/QBSyU9KVBogMRfg0='
WHERE
key_id = '2a5b7c3f1c6611ae3b1fff888c5826942e81a2d8c199fdda1c95cb8bce2465a7'
AND (
token = 'TMSFmYzrwLpeWVphHavhmNLZaW/QBSyU9KVBogMRfg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)