UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '86TtQfkOJEtyAFyWBk9QYkBNPpPW/SwmmPZAeAf68uA='
WHERE
key_id = '5ba79577f05b3158040d29b32f2c39394c4a742fba9d1682e6f4bc55c9e91795'
AND (
token = '86TtQfkOJEtyAFyWBk9QYkBNPpPW/SwmmPZAeAf68uA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)