UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCVGFwBk4zdE0GZOmMZb7Fn9t4a70QTA0Xlurad6pmk=' 
WHERE 
  key_id = '961af556f7e3c60f78f00f329665fb233ef752f163171bdc4ff210bfc619b472' 
  AND (
    token = 'UCVGFwBk4zdE0GZOmMZb7Fn9t4a70QTA0Xlurad6pmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028