UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZUgEHKn5N/cSHCKrZ420JVxtFa1vXjJ32skX9HH8/Oc=' 
WHERE 
  key_id = 'a1d21a2d7ce5169f0fde0d7b9d3e56d39497ebf1f5be64042f57937446437d7b' 
  AND (
    token = 'ZUgEHKn5N/cSHCKrZ420JVxtFa1vXjJ32skX9HH8/Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033