UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2qUm9oTccII2RuRBs2RAulIMNxrDJuJvUWCzzkphOoI=' 
WHERE 
  key_id = 'f9a9db3b02569e00cfe4d27248562281b69ade5e422f90b6cc1ed203a02672d6' 
  AND (
    token = '2qUm9oTccII2RuRBs2RAulIMNxrDJuJvUWCzzkphOoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018