UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3sY4SZiDdV5/sRNOrDclWwv5QUBSOVJf/hupPPvopnE=' 
WHERE 
  key_id = '1df2f6b8941136c50a509500c8286c49ffd1c27a4738dd9ea8b77ce1e296d7d4' 
  AND (
    token = '3sY4SZiDdV5/sRNOrDclWwv5QUBSOVJf/hupPPvopnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024