UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'igi6YLmVUhIYtcRjdzB3VnyeHAohonH0Tc0w0gPX1J0=' 
WHERE 
  key_id = '5f5a4820b1792c9b343ca1679924ba879f7b14149324f10148800d289ea974fa' 
  AND (
    token = 'igi6YLmVUhIYtcRjdzB3VnyeHAohonH0Tc0w0gPX1J0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023