UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tLl6Z4mLWKKy8Xz7Qtzmv5r15Huco/62Kdi0unyd6B8=' 
WHERE 
  key_id = '35ef33591645c06fac19ce6c951e078a4ae5d93e0ca92d7fbc664c37f6e57b43' 
  AND (
    token = 'tLl6Z4mLWKKy8Xz7Qtzmv5r15Huco/62Kdi0unyd6B8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026