UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FiXXP58egNhaP4zylMIUAZ/tW7XwTordnvGnIjcyG6A='
WHERE
key_id = 'bc69a64e5014e1d7a1dce110d4de9b11692be9b34f7e528b534e40cad8a8bbbf'
AND (
token = 'FiXXP58egNhaP4zylMIUAZ/tW7XwTordnvGnIjcyG6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)