UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lx0W5lKkjIO6MIOH47fbEABDi6QqZoInrziKgPrjJx4='
WHERE
key_id = 'be0faa2ebc828bc9043201fdfa25b2b28683cd063deb496ecc3b3618b813d799'
AND (
token = 'lx0W5lKkjIO6MIOH47fbEABDi6QqZoInrziKgPrjJx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)