UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VClI6RfsSfkRIaCYsoooejJkFSXyLe/uP38VWJZgIc='
WHERE
key_id = 'a4abb96a6cc12f4cac0d16b7eb1889b24957842c0768737c21fdb1ebd5e16dc3'
AND (
token = '5VClI6RfsSfkRIaCYsoooejJkFSXyLe/uP38VWJZgIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)