UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flCz2esIfmonygQEw/wKchZN3UVjEYeaoEH+9li7DDo=' 
WHERE 
  key_id = 'fcc550a8b28af0c690e7bc3602214b374288449f215fbb000570015429c9f8cb' 
  AND (
    token = 'flCz2esIfmonygQEw/wKchZN3UVjEYeaoEH+9li7DDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033