UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gstgdC7UjoDJQ2NG+5TeYLGa5CbNqeWiVlaAxp66DIo=' 
WHERE 
  key_id = '00fcf0ce6efab5b35da3fe382db2e3a351f20465dd04d5cfa256f21b9714b148' 
  AND (
    token = 'gstgdC7UjoDJQ2NG+5TeYLGa5CbNqeWiVlaAxp66DIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033