UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nodo+daRqo9c+szTH2o/B5I6TpvyQak4lIf+pS6nh+0=' 
WHERE 
  key_id = 'eb321793e7bb6ef954fd63028f03cb27200eee9a075955ad9279b515d2a64093' 
  AND (
    token = 'Nodo+daRqo9c+szTH2o/B5I6TpvyQak4lIf+pS6nh+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043