UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4kGTCJuDmzDUFWxIAJ7RVvTq9X6piSuQqZhSjKn6BFs=' 
WHERE 
  key_id = '492ac5de71673346e320038c22a1bf13a71396dba9863a3fc90fe83f3571dd6b' 
  AND (
    token = '4kGTCJuDmzDUFWxIAJ7RVvTq9X6piSuQqZhSjKn6BFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028