UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZ1XagKW45bDyTAz0yPtKR84xnVBbd/HtjpmrDeO4nw=' 
WHERE 
  key_id = 'c7956199a7be0d3effc385db1d5b435ae49bfdfb3d426851a1fc80fe1ebfde24' 
  AND (
    token = 'lZ1XagKW45bDyTAz0yPtKR84xnVBbd/HtjpmrDeO4nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018