UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QpYN2tuggm/icQhYZr6OjkgXSV+YHWGv/k4Gk5UxfzE=' 
WHERE 
  key_id = '1c0ac3837ced9715dbc28d2ab39cbefabb55eafc0cddce762f0431efb580775d' 
  AND (
    token = 'QpYN2tuggm/icQhYZr6OjkgXSV+YHWGv/k4Gk5UxfzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029